<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>web2py.gluon.thread_local_singleton</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="web2py.gluon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;web2py ::
        <a href="web2py.gluon-module.html">Package&nbsp;gluon</a> ::
        Module&nbsp;thread_local_singleton
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="web2py.gluon.thread_local_singleton-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="web2py.gluon.thread_local_singleton-module.html">Module web2py.gluon.thread_local_singleton</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">threading</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"> </tt>
<a name="Singleton"></a><div id="Singleton-def"><a name="L3"></a><tt class="py-lineno"> 3</tt> <a class="py-toggle" href="#" id="Singleton-toggle" onclick="return toggle('Singleton');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html">Singleton</a><tt class="py-op">(</tt><tt class="py-base-class">dict</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="Singleton-expanded"><a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-docstring">    This class makes a thread local Singleton </tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-docstring">    (i.e. every threads sees a differnt singleton)</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-docstring">    It also makes a different singleton for each derived class.</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-docstring">    The objects behave like dictionaries and attributes/values</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-docstring">    are mapped into keys/values.</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-docstring">    But, while if not 'x' in a, a['x'] raises and exception a.x returns None</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-docstring">    Example:</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; a=Singleton()</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; a.x=1</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; b=Singleton() # same singleton as a</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print b.x</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"><tt class="py-docstring">    1</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; class C(Singleton): pass</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; c=C()         # new singleton</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; c.y=2</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; d=C()         # same singleton as c</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print d.x, d.y</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line"><tt class="py-docstring">    None, 2</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; d.set_state({}) # state can be reset</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print d.x, d.y</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line"><tt class="py-docstring">    None None</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">    <tt id="link-0" class="py-name" targets="Variable web2py.gluon.rewrite.thread=web2py.gluon.rewrite-module.html#thread,Variable web2py.gluon.sql.thread=web2py.gluon.sql-module.html#thread,Variable web2py.gluon.thread_local_singleton.Singleton.thread=web2py.gluon.thread_local_singleton.Singleton-class.html#thread"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-0', 'thread', 'link-0');">thread</a></tt> <tt class="py-op">=</tt> <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt class="py-name">local</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="Singleton.__init__"></a><div id="Singleton.__init__-def"><a name="L29"></a><tt class="py-lineno">29</tt> <a class="py-toggle" href="#" id="Singleton.__init__-toggle" onclick="return toggle('Singleton.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__init__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__init__-expanded"><a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt id="link-1" class="py-name" targets="Class web2py.gluon.thread_local_singleton.Singleton=web2py.gluon.thread_local_singleton.Singleton-class.html"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-1', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-2" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-2', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line">            <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt id="link-3" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-3', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-4" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-4', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt>         </tt>
</div><a name="Singleton.__getitem__"></a><div id="Singleton.__getitem__-def"><a name="L32"></a><tt class="py-lineno">32</tt> <a class="py-toggle" href="#" id="Singleton.__getitem__-toggle" onclick="return toggle('Singleton.__getitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__getitem__">__getitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__getitem__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__getitem__-expanded"><a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-5" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-5', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-6" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-6', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
</div><a name="Singleton.__setitem__"></a><div id="Singleton.__setitem__-def"><a name="L34"></a><tt class="py-lineno">34</tt> <a class="py-toggle" href="#" id="Singleton.__setitem__-toggle" onclick="return toggle('Singleton.__setitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__setitem__">__setitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">key</tt><tt class="py-op">,</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__setitem__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__setitem__-expanded"><a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">        <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-7" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-7', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-8', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">value</tt> </tt>
</div><a name="Singleton.__setattr__"></a><div id="Singleton.__setattr__-def"><a name="L36"></a><tt class="py-lineno">36</tt> <a class="py-toggle" href="#" id="Singleton.__setattr__-toggle" onclick="return toggle('Singleton.__setattr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__setattr__">__setattr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">key</tt><tt class="py-op">,</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__setattr__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__setattr__-expanded"><a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">        <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-9" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-9', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-10', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">value</tt> </tt>
</div><a name="Singleton.__delattr__"></a><div id="Singleton.__delattr__-def"><a name="L38"></a><tt class="py-lineno">38</tt> <a class="py-toggle" href="#" id="Singleton.__delattr__-toggle" onclick="return toggle('Singleton.__delattr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__delattr__">__delattr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>         </tt>
</div><a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">        <tt class="py-keyword">del</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-11" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-11', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-12', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
</div><a name="Singleton.get"></a><div id="Singleton.get-def"><a name="L40"></a><tt class="py-lineno">40</tt> <a class="py-toggle" href="#" id="Singleton.get-toggle" onclick="return toggle('Singleton.get');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#get">get</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">key</tt><tt class="py-op">,</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.get-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.get-expanded"><a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-13" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-13', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-14', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method web2py.gluon.rocket.Headers.get()=web2py.gluon.rocket.Headers-class.html#get,Method web2py.gluon.thread_local_singleton.Singleton.get()=web2py.gluon.thread_local_singleton.Singleton-class.html#get"><a title="web2py.gluon.rocket.Headers.get
web2py.gluon.thread_local_singleton.Singleton.get" class="py-name" href="#" onclick="return doclink('link-15', 'get', 'link-15');">get</a></tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">,</tt><tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__getattr__"></a><div id="Singleton.__getattr__-def"><a name="L42"></a><tt class="py-lineno">42</tt> <a class="py-toggle" href="#" id="Singleton.__getattr__-toggle" onclick="return toggle('Singleton.__getattr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__getattr__">__getattr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__getattr__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__getattr__-expanded"><a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-16" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-16', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-17" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-17', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="web2py.gluon.rocket.Headers.get
web2py.gluon.thread_local_singleton.Singleton.get" class="py-name" href="#" onclick="return doclink('link-18', 'get', 'link-15');">get</a></tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__repr__"></a><div id="Singleton.__repr__-def"><a name="L44"></a><tt class="py-lineno">44</tt> <a class="py-toggle" href="#" id="Singleton.__repr__-toggle" onclick="return toggle('Singleton.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__repr__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__repr__-expanded"><a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'&lt;Storage '</tt> <tt class="py-op">+</tt> <tt class="py-name">repr</tt><tt class="py-op">(</tt><tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-19" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-19', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-20', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'&gt;'</tt> </tt>
</div><a name="Singleton.__str__"></a><div id="Singleton.__str__-def"><a name="L46"></a><tt class="py-lineno">46</tt> <a class="py-toggle" href="#" id="Singleton.__str__-toggle" onclick="return toggle('Singleton.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__str__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__str__-expanded"><a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-21" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-21', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-22', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__getstate__"></a><div id="Singleton.__getstate__-def"><a name="L48"></a><tt class="py-lineno">48</tt> <a class="py-toggle" href="#" id="Singleton.__getstate__-toggle" onclick="return toggle('Singleton.__getstate__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__getstate__">__getstate__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__getstate__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__getstate__-expanded"><a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-23" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-23', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-24', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__setstate__"></a><div id="Singleton.__setstate__-def"><a name="L50"></a><tt class="py-lineno">50</tt> <a class="py-toggle" href="#" id="Singleton.__setstate__-toggle" onclick="return toggle('Singleton.__setstate__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__setstate__">__setstate__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__setstate__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__setstate__-expanded"><a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">        <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt id="link-25" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-25', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-26', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__cmp__"></a><div id="Singleton.__cmp__-def"><a name="L52"></a><tt class="py-lineno">52</tt> <a class="py-toggle" href="#" id="Singleton.__cmp__-toggle" onclick="return toggle('Singleton.__cmp__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__cmp__">__cmp__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__cmp__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__cmp__-expanded"><a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
</div><a name="Singleton.__contains__"></a><div id="Singleton.__contains__-def"><a name="L54"></a><tt class="py-lineno">54</tt> <a class="py-toggle" href="#" id="Singleton.__contains__-toggle" onclick="return toggle('Singleton.__contains__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__contains__">__contains__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__contains__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__contains__-expanded"><a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-27" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-27', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-28', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__hash__"></a><div id="Singleton.__hash__-def"><a name="L56"></a><tt class="py-lineno">56</tt> <a class="py-toggle" href="#" id="Singleton.__hash__-toggle" onclick="return toggle('Singleton.__hash__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__hash__">__hash__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__hash__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__hash__-expanded"><a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-29" class="py-name" targets="Function web2py.gluon.utils.hash()=web2py.gluon.utils-module.html#hash"><a title="web2py.gluon.utils.hash" class="py-name" href="#" onclick="return doclink('link-29', 'hash', 'link-29');">hash</a></tt><tt class="py-op">(</tt><tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-30" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-30', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-31" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-31', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__len__"></a><div id="Singleton.__len__-def"><a name="L58"></a><tt class="py-lineno">58</tt> <a class="py-toggle" href="#" id="Singleton.__len__-toggle" onclick="return toggle('Singleton.__len__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__len__">__len__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__len__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__len__-expanded"><a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-32" class="py-name" targets="Method web2py.gluon.dal.Field.len()=web2py.gluon.dal.Field-class.html#len,Method web2py.gluon.sql.Expression.len()=web2py.gluon.sql.Expression-class.html#len"><a title="web2py.gluon.dal.Field.len
web2py.gluon.sql.Expression.len" class="py-name" href="#" onclick="return doclink('link-32', 'len', 'link-32');">len</a></tt><tt class="py-op">(</tt><tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-33" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-33', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-34" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-34', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.has_key"></a><div id="Singleton.has_key-def"><a name="L60"></a><tt class="py-lineno">60</tt> <a class="py-toggle" href="#" id="Singleton.has_key-toggle" onclick="return toggle('Singleton.has_key');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#has_key">has_key</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.has_key-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.has_key-expanded"><a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> </tt>
</div><a name="Singleton.keys"></a><div id="Singleton.keys-def"><a name="L62"></a><tt class="py-lineno">62</tt> <a class="py-toggle" href="#" id="Singleton.keys-toggle" onclick="return toggle('Singleton.keys');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#keys">keys</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.keys-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.keys-expanded"><a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-35" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-35', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-36', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name" targets="Method web2py.gluon.rocket.Headers.keys()=web2py.gluon.rocket.Headers-class.html#keys,Method web2py.gluon.thread_local_singleton.Singleton.keys()=web2py.gluon.thread_local_singleton.Singleton-class.html#keys,Method web2py.gluon.tools.PluginManager.keys()=web2py.gluon.tools.PluginManager-class.html#keys"><a title="web2py.gluon.rocket.Headers.keys
web2py.gluon.thread_local_singleton.Singleton.keys
web2py.gluon.tools.PluginManager.keys" class="py-name" href="#" onclick="return doclink('link-37', 'keys', 'link-37');">keys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.values"></a><div id="Singleton.values-def"><a name="L64"></a><tt class="py-lineno">64</tt> <a class="py-toggle" href="#" id="Singleton.values-toggle" onclick="return toggle('Singleton.values');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#values">values</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.values-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.values-expanded"><a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-38" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-38', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-39" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-39', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name" targets="Method web2py.gluon.rocket.Headers.values()=web2py.gluon.rocket.Headers-class.html#values,Method web2py.gluon.thread_local_singleton.Singleton.values()=web2py.gluon.thread_local_singleton.Singleton-class.html#values"><a title="web2py.gluon.rocket.Headers.values
web2py.gluon.thread_local_singleton.Singleton.values" class="py-name" href="#" onclick="return doclink('link-40', 'values', 'link-40');">values</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.items"></a><div id="Singleton.items-def"><a name="L66"></a><tt class="py-lineno">66</tt> <a class="py-toggle" href="#" id="Singleton.items-toggle" onclick="return toggle('Singleton.items');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#items">items</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.items-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.items-expanded"><a name="L67"></a><tt class="py-lineno">67</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-41" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-41', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-42', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name" targets="Method web2py.gluon.rocket.Headers.items()=web2py.gluon.rocket.Headers-class.html#items,Method web2py.gluon.thread_local_singleton.Singleton.items()=web2py.gluon.thread_local_singleton.Singleton-class.html#items"><a title="web2py.gluon.rocket.Headers.items
web2py.gluon.thread_local_singleton.Singleton.items" class="py-name" href="#" onclick="return doclink('link-43', 'items', 'link-43');">items</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.iterkeys"></a><div id="Singleton.iterkeys-def"><a name="L68"></a><tt class="py-lineno">68</tt> <a class="py-toggle" href="#" id="Singleton.iterkeys-toggle" onclick="return toggle('Singleton.iterkeys');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#iterkeys">iterkeys</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.iterkeys-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.iterkeys-expanded"><a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-44" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-44', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-45', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name" targets="Method web2py.gluon.thread_local_singleton.Singleton.iterkeys()=web2py.gluon.thread_local_singleton.Singleton-class.html#iterkeys"><a title="web2py.gluon.thread_local_singleton.Singleton.iterkeys" class="py-name" href="#" onclick="return doclink('link-46', 'iterkeys', 'link-46');">iterkeys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.itervalues"></a><div id="Singleton.itervalues-def"><a name="L70"></a><tt class="py-lineno">70</tt> <a class="py-toggle" href="#" id="Singleton.itervalues-toggle" onclick="return toggle('Singleton.itervalues');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#itervalues">itervalues</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.itervalues-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.itervalues-expanded"><a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-47" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-47', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-48', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name" targets="Method web2py.gluon.thread_local_singleton.Singleton.itervalues()=web2py.gluon.thread_local_singleton.Singleton-class.html#itervalues"><a title="web2py.gluon.thread_local_singleton.Singleton.itervalues" class="py-name" href="#" onclick="return doclink('link-49', 'itervalues', 'link-49');">itervalues</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.iteritems"></a><div id="Singleton.iteritems-def"><a name="L72"></a><tt class="py-lineno">72</tt> <a class="py-toggle" href="#" id="Singleton.iteritems-toggle" onclick="return toggle('Singleton.iteritems');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#iteritems">iteritems</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.iteritems-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.iteritems-expanded"><a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-50" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-50', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-51', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name" targets="Method web2py.gluon.thread_local_singleton.Singleton.iteritems()=web2py.gluon.thread_local_singleton.Singleton-class.html#iteritems"><a title="web2py.gluon.thread_local_singleton.Singleton.iteritems" class="py-name" href="#" onclick="return doclink('link-52', 'iteritems', 'link-52');">iteritems</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.update"></a><div id="Singleton.update-def"><a name="L74"></a><tt class="py-lineno">74</tt> <a class="py-toggle" href="#" id="Singleton.update-toggle" onclick="return toggle('Singleton.update');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#update">update</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">*</tt><tt class="py-param">a</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">b</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.update-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.update-expanded"><a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-53" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-53', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-54', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name" targets="Method web2py.gluon.dal.Set.update()=web2py.gluon.dal.Set-class.html#update,Method web2py.gluon.html.DIV.update()=web2py.gluon.html.DIV-class.html#update,Method web2py.gluon.sql.Set.update()=web2py.gluon.sql.Set-class.html#update,Method web2py.gluon.thread_local_singleton.Singleton.update()=web2py.gluon.thread_local_singleton.Singleton-class.html#update,Method web2py.gluon.tools.Crud.update()=web2py.gluon.tools.Crud-class.html#update,Method web2py.gluon.widget.web2pyDialog.update()=web2py.gluon.widget.web2pyDialog-class.html#update"><a title="web2py.gluon.dal.Set.update
web2py.gluon.html.DIV.update
web2py.gluon.sql.Set.update
web2py.gluon.thread_local_singleton.Singleton.update
web2py.gluon.tools.Crud.update
web2py.gluon.widget.web2pyDialog.update" class="py-name" href="#" onclick="return doclink('link-55', 'update', 'link-55');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">a</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt id="link-56" class="py-name" targets="Function web2py.gluon.rocket.b()=web2py.gluon.rocket-module.html#b"><a title="web2py.gluon.rocket.b" class="py-name" href="#" onclick="return doclink('link-56', 'b', 'link-56');">b</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.popitem"></a><div id="Singleton.popitem-def"><a name="L76"></a><tt class="py-lineno">76</tt> <a class="py-toggle" href="#" id="Singleton.popitem-toggle" onclick="return toggle('Singleton.popitem');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#popitem">popitem</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.popitem-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.popitem-expanded"><a name="L77"></a><tt class="py-lineno">77</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-57" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-57', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-58" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-58', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-59" class="py-name" targets="Method web2py.gluon.thread_local_singleton.Singleton.popitem()=web2py.gluon.thread_local_singleton.Singleton-class.html#popitem"><a title="web2py.gluon.thread_local_singleton.Singleton.popitem" class="py-name" href="#" onclick="return doclink('link-59', 'popitem', 'link-59');">popitem</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.clear"></a><div id="Singleton.clear-def"><a name="L78"></a><tt class="py-lineno">78</tt> <a class="py-toggle" href="#" id="Singleton.clear-toggle" onclick="return toggle('Singleton.clear');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#clear">clear</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.clear-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.clear-expanded"><a name="L79"></a><tt class="py-lineno">79</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-60" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-60', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-61', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-62" class="py-name" targets="Method web2py.gluon.cache.CacheAbstract.clear()=web2py.gluon.cache.CacheAbstract-class.html#clear,Method web2py.gluon.cache.CacheInRam.clear()=web2py.gluon.cache.CacheInRam-class.html#clear,Method web2py.gluon.cache.CacheOnDisk.clear()=web2py.gluon.cache.CacheOnDisk-class.html#clear,Method web2py.gluon.thread_local_singleton.Singleton.clear()=web2py.gluon.thread_local_singleton.Singleton-class.html#clear"><a title="web2py.gluon.cache.CacheAbstract.clear
web2py.gluon.cache.CacheInRam.clear
web2py.gluon.cache.CacheOnDisk.clear
web2py.gluon.thread_local_singleton.Singleton.clear" class="py-name" href="#" onclick="return doclink('link-62', 'clear', 'link-62');">clear</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.copy"></a><div id="Singleton.copy-def"><a name="L80"></a><tt class="py-lineno">80</tt> <a class="py-toggle" href="#" id="Singleton.copy-toggle" onclick="return toggle('Singleton.copy');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#copy">copy</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.copy-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.copy-expanded"><a name="L81"></a><tt class="py-lineno">81</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-63" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-63', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-64" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-64', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name" targets="Method web2py.gluon.thread_local_singleton.Singleton.copy()=web2py.gluon.thread_local_singleton.Singleton-class.html#copy"><a title="web2py.gluon.thread_local_singleton.Singleton.copy" class="py-name" href="#" onclick="return doclink('link-65', 'copy', 'link-65');">copy</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.__iter__"></a><div id="Singleton.__iter__-def"><a name="L82"></a><tt class="py-lineno">82</tt> <a class="py-toggle" href="#" id="Singleton.__iter__-toggle" onclick="return toggle('Singleton.__iter__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#__iter__">__iter__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.__iter__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.__iter__-expanded"><a name="L83"></a><tt class="py-lineno">83</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-66" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-66', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-67', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-68" class="py-name" targets="Method web2py.gluon.dal.DAL.__iter__()=web2py.gluon.dal.DAL-class.html#__iter__,Method web2py.gluon.dal.Rows.__iter__()=web2py.gluon.dal.Rows-class.html#__iter__,Method web2py.gluon.dal.Table.__iter__()=web2py.gluon.dal.Table-class.html#__iter__,Method web2py.gluon.html.XML.__iter__()=web2py.gluon.html.XML-class.html#__iter__,Method web2py.gluon.languages.lazyT.__iter__()=web2py.gluon.languages.lazyT-class.html#__iter__,Method web2py.gluon.rocket.FileWrapper.__iter__()=web2py.gluon.rocket.FileWrapper-class.html#__iter__,Method web2py.gluon.sql.Rows.__iter__()=web2py.gluon.sql.Rows-class.html#__iter__,Method web2py.gluon.sql.SQLDB.__iter__()=web2py.gluon.sql.SQLDB-class.html#__iter__,Method web2py.gluon.sql.Table.__iter__()=web2py.gluon.sql.Table-class.html#__iter__,Method web2py.gluon.thread_local_singleton.Singleton.__iter__()=web2py.gluon.thread_local_singleton.Singleton-class.html#__iter__"><a title="web2py.gluon.dal.DAL.__iter__
web2py.gluon.dal.Rows.__iter__
web2py.gluon.dal.Table.__iter__
web2py.gluon.html.XML.__iter__
web2py.gluon.languages.lazyT.__iter__
web2py.gluon.rocket.FileWrapper.__iter__
web2py.gluon.sql.Rows.__iter__
web2py.gluon.sql.SQLDB.__iter__
web2py.gluon.sql.Table.__iter__
web2py.gluon.thread_local_singleton.Singleton.__iter__" class="py-name" href="#" onclick="return doclink('link-68', '__iter__', 'link-68');">__iter__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.get_state"></a><div id="Singleton.get_state-def"><a name="L84"></a><tt class="py-lineno">84</tt> <a class="py-toggle" href="#" id="Singleton.get_state-toggle" onclick="return toggle('Singleton.get_state');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#get_state">get_state</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.get_state-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.get_state-expanded"><a name="L85"></a><tt class="py-lineno">85</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-69" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-69', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-70" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-70', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Singleton.set_state"></a><div id="Singleton.set_state-def"><a name="L86"></a><tt class="py-lineno">86</tt> <a class="py-toggle" href="#" id="Singleton.set_state-toggle" onclick="return toggle('Singleton.set_state');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="web2py.gluon.thread_local_singleton.Singleton-class.html#set_state">set_state</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">storage</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Singleton.set_state-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Singleton.set_state-expanded"><a name="L87"></a><tt class="py-lineno">87</tt>  <tt class="py-line">        <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt id="link-71" class="py-name"><a title="web2py.gluon.thread_local_singleton.Singleton" class="py-name" href="#" onclick="return doclink('link-71', 'Singleton', 'link-1');">Singleton</a></tt><tt class="py-op">.</tt><tt id="link-72" class="py-name"><a title="web2py.gluon.rewrite.thread
web2py.gluon.sql.thread
web2py.gluon.thread_local_singleton.Singleton.thread" class="py-name" href="#" onclick="return doclink('link-72', 'thread', 'link-0');">thread</a></tt><tt class="py-op">,</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt id="link-73" class="py-name" targets="Module web2py.gluon.storage=web2py.gluon.storage-module.html"><a title="web2py.gluon.storage" class="py-name" href="#" onclick="return doclink('link-73', 'storage', 'link-73');">storage</a></tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L88"></a><tt class="py-lineno">88</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="web2py.gluon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Wed Oct 13 19:44:46 2010
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
